tags
(GtkBuilderConverter._convert_menuitem): Add support for CheckMenuItems
and do not set name and action on separators
+ (GtkBuilderConverter._add_action_from_menuitem): Only set stock_id
+ on the action if the menuitem had a stock or label property set
2007-07-06 Richard Hult <richard@imendio.com>
if (children and
children[0].getAttribute('internal-child') == 'image'):
image = get_object_node(children[0])
- properties['stock_id'] = get_property(image, 'stock')
+ stock_id = get_property(node, 'stock')
+ if stock_id is not None:
+ properties['stock_id'] = stock_id
elif object_class == 'GtkMenuItem':
name = 'GtkAction'
label = get_property(node, 'label')
raise NotImplementedError(object_class)
if get_property(node, 'use_stock') == 'True':
- properties['stock_id'] = get_property(node, 'label')
+ stock_id = get_property(node, 'label')
+ if stock_id is not None:
+ properties['stock_id'] = stock_id
+
properties['name'] = object_id
action = self._create_object(name,
object_id,